﻿CREATE TABLE [dbo].[ParamListe] (
    [IDParam]          INT           IDENTITY (1, 1) NOT NULL,
    [IDLista]          SMALLINT      NOT NULL,
    [Cod]              VARCHAR (3)   CONSTRAINT [DF_ParamListe_Cod] DEFAULT ('') NOT NULL,
    [NrCrt]            SMALLINT      CONSTRAINT [DF_ParamListe_NrCrt] DEFAULT (0) NOT NULL,
    [Denumire]         VARCHAR (100) NOT NULL,
    [Valoare]          VARCHAR (100) CONSTRAINT [DF_ParamListe_Valoare] DEFAULT ('') NOT NULL,
    [ValoareImplicita] VARCHAR (100) CONSTRAINT [DF_ParamListe_ValoareImplicita] DEFAULT ('') NOT NULL,
    [Tip]              VARCHAR (100) CONSTRAINT [DF_ParamListe_Tip] DEFAULT ('VC') NOT NULL,
    [Validare]         VARCHAR (100) CONSTRAINT [DF_ParamListe_Validare] DEFAULT ('') NOT NULL,
    [SelRezumat]       VARCHAR (200) CONSTRAINT [DF_ParamListe_SelRezumat] DEFAULT ('') NOT NULL,
    [User]             VARCHAR (50)  CONSTRAINT [DF_ParamListe_uid] DEFAULT (suser_sname()) NOT NULL,
    [Host]             VARCHAR (50)  CONSTRAINT [DF_ParamListe_Host] DEFAULT (host_name()) NOT NULL,
    [CodUnitate]       SMALLINT      CONSTRAINT [DF_ParamListe_CodUnit] DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_ParamListe] PRIMARY KEY CLUSTERED ([IDParam] ASC) WITH (FILLFACTOR = 90),
    CONSTRAINT [FK_ParamListe_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);


GO
CREATE NONCLUSTERED INDEX [IX_ParamListe]
    ON [dbo].[ParamListe]([Host] ASC, [User] ASC, [IDLista] ASC, [Cod] ASC) WITH (FILLFACTOR = 90);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Numele statie de lucru', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ParamListe', @level2type = N'COLUMN', @level2name = N'Host';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'utilizatorul pentru care sunt salvate valorile', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ParamListe', @level2type = N'COLUMN', @level2name = N'User';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'rezumatul pentru selectie', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ParamListe', @level2type = N'COLUMN', @level2name = N'SelRezumat';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Denumirea Parametrului', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ParamListe', @level2type = N'COLUMN', @level2name = N'Denumire';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Codificarea interna', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ParamListe', @level2type = N'COLUMN', @level2name = N'Cod';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Identificatorul Listei de care apartine parametrul', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ParamListe', @level2type = N'COLUMN', @level2name = N'IDLista';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Identificatorul Parametrului', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'ParamListe', @level2type = N'COLUMN', @level2name = N'IDParam';

